home *** CD-ROM | disk | FTP | other *** search
- on animatebugs
- global inanimate, animstage, animtimer, animshuffle, shufflestep, jostling
- if not listp(inanimate) then
- set animshuffle to [:]
- set shufflestep to [random(6 * count(jostling)), random(6 * count(jostling))]
- addProp(animshuffle, the locH of sprite 21, the locV of sprite 21)
- addProp(animshuffle, the locH of sprite 22, the locV of sprite 22)
- set inanimate to [the castNum of sprite 21, the castNum of sprite 22]
- set animstage to [0, 0]
- set animtimer to [0, 0]
- end if
- repeat with xxx = 1 to 2
- set ystep to getAt(shufflestep, xxx) + 1
- set pstep to ystep / 8
- if pstep > count(jostling) then
- set pstep to 1
- set ystep to 1
- end if
- if pstep < 1 then
- set pstep to 1
- end if
- set the locH of sprite (20 + xxx) to getPropAt(animshuffle, xxx) + getPropAt(jostling, pstep)
- set the locV of sprite (20 + xxx) to getAt(animshuffle, xxx) + getAt(jostling, pstep)
- setAt(shufflestep, xxx, ystep)
- if getAt(animstage, xxx) = 0 then
- if random(40) = 1 then
- setAt(animstage, xxx, 1)
- set the castNum of sprite (20 + xxx) to getAt(inanimate, xxx) + 1
- end if
- next repeat
- end if
- set ptime to getAt(animtimer, xxx)
- set ptime to ptime + 1
- if ptime > 5 then
- if getAt(animstage, xxx) = 1 then
- set the castNum of sprite (20 + xxx) to getAt(inanimate, xxx) + 2
- setAt(animstage, xxx, 2)
- else
- set the castNum of sprite (20 + xxx) to getAt(inanimate, xxx)
- setAt(animstage, xxx, 0)
- end if
- setAt(animtimer, xxx, 0)
- next repeat
- end if
- setAt(animtimer, xxx, ptime)
- end repeat
- go(the frame)
- end
-
- on BugReset
- global inanimate
- if listp(inanimate) then
- repeat with xxx = 1 to 2
- set the castNum of sprite (xxx + 20) to getAt(inanimate, xxx)
- end repeat
- end if
- set inanimate to 0
- end
-